{extend name="base" /}
<!-- page specific plugin styles -->
{block name="inline-styles"}
{/block}
<!-- PAGE CONTENT BEGINS -->
{block name="content"}
<div class="page js_show">
    <div class="page__bd" style="height: 100%">
        <div class="weui-tab">
            <div class="weui-tab__panel" id="ajaxForm">

				<div class="weui-panel weui-page-home_head">
					<div class="weui-panel__bd">
						<div class="weui-media-box user_haed">
							<a class="weui-media-box__hd" href="{:url('Index/profile')}">
								<img class="weui-media-box__thumb" id="avatar" src="/static/ace/assets/images/avatars/avatar5.png" width="50" height="50">
							</a>
							<div class="weui-media-box__bd">
								<h4 class="weui-media-box__title" id="name"></h4>
                                <div class="weui-media-box__info">
                                    <span class="weui-media-box__info__grade" id="grade"></span>
                                    <span class="weui-media-box__info__money">虚拟币:<span id="balance">0.00</span>元</span>
                                </div>
							</div>
						</div>
					</div>
					<div class="weui-panel__ft">
						<div class="weui-nav">
							<p class="weui-grid__label">邀请成为代理</p>
						</div>
					</div>
				</div>


				<a href="javascript:;" class="open-popup" data-target="#about">
					<div class="weui-grid__icon">
						<i class="fa fa-users"></i>
					</div>
					<p class="weui-grid__label">品正商</p>
				</a>

            </div>
            <div class="weui-tabbar">
                <a href="{:url('Index/home')}" class="weui-tabbar__item weui-bar__item_on">
                    <div class="weui-tabbar__icon">
                    	<i class="fa fa-home"></i>
                    </div>
                    <p class="weui-tabbar__label">主页</p>
                </a>
                <a href="javascript:;" class="weui-tabbar__item">
                    <div class="weui-tabbar__icon">
                    	<i class="fa fa-list"></i>
                    </div>
                    <p class="weui-tabbar__label">下单</p>
                </a>
            </div>
        </div>
    </div>
</div>

<div id="about" class="weui-popup__container popup-bottom">
  <div class="weui-popup__overlay"></div>
  <div class="weui-popup__modal">
  	<p style="padding: 25px;text-align: center; "><img src="/api/v1/member/yaoqing.html" width="200"></p>
    
  </div>
</div>
{/block}
<!-- PAGE CONTENT ENDS -->
<!-- inline scripts related to this page -->
{block name="related-scripts"}
<script type="text/javascript">
    // 查询个人信息
    $.ajax({
        url: '/api/v1/member/index',
        type: 'GET',
        dataType: 'json',
    })
    .done(function(json) {
        console.log("success");
        $("#avatar").attr("src",json.data.avatar);
        initPageHTML("ajaxForm",json.data);
    })
    .fail(function() {
        console.log("error");
    })
    .always(function() {
        console.log("complete");
    });
    
</script>
{/block}